<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title>OnlineShop</title>
    </h:head>
    <h:body>
<f:view>
    <c:set scope="view" value="0" var="total"/>
<table border="0" width="650" rules="none" cellspacing="0" cellpadding="0" >
<tr>
<td>
    <h:form>
   <table border="0" width="550" rules="none" cellspacing="0" cellpadding="0">
	<tr><td  height="80" colspan="3"  width="550" align="left"><p  style="font-size:80pt; color: fuchsia">今日推荐</p>
        </td></tr>
	<tr align="center" height="30" bgcolor="lightgrey">
	   <td></td>
           <td>名称</td>
	   <td>价格(元/斤)</td>
	   <td>购买</td>
	</tr>
       <c:choose>
       <c:when test="#{empty(goods.goodslist)}">
	<tr height="100"><td colspan="3" align="center">没有商品可显示！</td></tr>
       </c:when>
        <c:otherwise>           
            <c:forEach var="single"  items="#{goods.goodslist}">
	<tr height="50" align="center">
        <td><img src="resources/img/#{single.img}" height="150"  width="300" hspace="20" vspace="10"/></td>
	    <td>#{single.name}</td>
            <td>#{single['price']}</td>
            <td> 
                <h:commandLink  action="#{myCar.addItem(single)}" value="购买"/>
            </td>
	</tr>
            </c:forEach>
        </c:otherwise>
       </c:choose>
     <tr height="50">
      <td align="center" colspan="3"><a href="shopcar.xhtml">查看购物车</a></td>
     </tr>
     </table>
    </h:form>
  </td>
    <td><a href="littleShopcar.jsp" />littleShopcar.jsp</td>
</tr>
</table>
</f:view>
</h:body>
</html>

